/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model.Entity.Web;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author user12
 */
@Embeddable
public class VoteOptionPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "OPTION_ID")
    private Integer optionId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "VOTE_ID")
    private Integer voteId;

    public VoteOptionPK() {
    }

    public VoteOptionPK(Integer optionId, Integer voteId) {
        this.optionId = optionId;
        this.voteId = voteId;
    }

    public Integer getOptionId() {
        return optionId;
    }

    public void setOptionId(Integer optionId) {
        this.optionId = optionId;
    }

    public Integer getVoteId() {
        return voteId;
    }

    public void setVoteId(Integer voteId) {
        this.voteId = voteId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (optionId != null ? optionId.hashCode() : 0);
        hash += (voteId != null ? voteId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof VoteOptionPK)) {
            return false;
        }
        VoteOptionPK other = (VoteOptionPK) object;
        if ((this.optionId == null && other.optionId != null) || (this.optionId != null && !this.optionId.equals(other.optionId))) {
            return false;
        }
        if ((this.voteId == null && other.voteId != null) || (this.voteId != null && !this.voteId.equals(other.voteId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.WebVoteOptionPK[ optionId=" + optionId + ", voteId=" + voteId + " ]";
    }
    
}
